import { reactive } from 'vue';

function getRef() {
  const line = reactive({
    x: 0,
    width: 40
  })
  function moveLine(event: Event) {
    const target = event.target as HTMLDivElement;
    if (target.tagName == "NAV") return;
    const x = target.offsetLeft;
    const width = target.offsetWidth;
    line.x = x;
    line.width = width;
  }
  return {
    line,
    moveLine,

  }
}


export {
  getRef,
}